<template>
  <van-cell class="find-item" is-link center size="large">
    <template #title>
      <van-row>
        <van-col span="12" class="find-item-left">
          <svg class="find-icon">
            <use :xlink:href="icon"></use>
          </svg>
          <span class="find-title">{{title}}</span>
        </van-col>
        <van-col span="12" class="find-item-right" v-if="customLayout=='icon-text'">
          <span class="find-title-right" v-if="customContent">{{customContent}}</span>
          <van-badge class="custom-icon" v-if="customIcon" dot>
            <van-image
              class="custom-icon"
              :show-loading="loading"
              radius="4"
              :src="customIcon"/>
          </van-badge>
        </van-col>
        <van-col span="12" class="find-item-right" v-if="customLayout=='text-icon'">
          <van-badge class="custom-icon" v-if="customIcon" dot>
            <van-image
              class="custom-icon"
              :show-loading="loading"
              radius="4"
              :src="customIcon"/>
          </van-badge>
          <span class="find-title-right" v-if="customContent">{{customContent}}</span>
        </van-col>
      </van-row>
    </template>
  </van-cell>
</template>

<script>
  export default {
    name: "ListCell",
    props: {
      icon: {
        type: String,
        default: ""
      },
      title: {
        type: String,
        default: ""
      },
      customIcon: {
        type: String,
        default: ""
      },
      customContent: {
        type: String,
        default: ""
      },
      customLayout: {
        type: String,
        default: "icon-text"
      }
    },
    data () {
      return {
        loading: false,
      }
    },
    method: {
    }
  }
</script>

<style scoped>
  .find-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    overflow: hidden;
    padding-right: 16px;
    vertical-align: bottom;
  }
  .custom-icon {
    width: 30px;
    height: 30px;
    float: right;
    margin-left: 6px;
    overflow: hidden;
    vertical-align: bottom;
  }
  .find-item {
    height: 50px;
    width: 100%;
  }
  .find-item-left {
    padding-top: 4px;
  }
  .find-item-right {
    padding: 0 0px;
  }
  .find-title {
    font-size: 16px;
  }
  .find-title-right {
    line-height: 34px;
    color: #ababab;
    font-size: 14px;
    padding-left: 6px;
    float: right;
  }
</style>